<div id="indexcates">
        <?php
                global $db;
                $sql = "select * from nettteach_department where 1 = 1";
                $result_department = $db -> query($sql);
                while($row_department=$db->fetch_array($result_department)){

        ?>
        <div class="span9">
        <div class="row-fluid" style="margin-top:10px;">
            <ul class="breadcrumb">
                <li><a href="#"><?php echo ($row_department['name'])?> </a> </li>
            </ul>
        </div>			
        <div id="01">
            <div class="row-fluid">
        <?php
                $sql = "select * from nettteach_major where  departmentid = '".$row_department['id']."' ";
                $result = $db -> query($sql);
                while($row=$db->fetch_array($result)){
                        $sql_courseware = "select cw.id from nettteach_courseware cw,nettteach_member mb where cw.writerid = mb.id and mb.majorid='".$row['id']."' and cw.state ='0' ";
                        $result_courseware = $db -> query($sql_courseware);
                        $resultcount = $db->num_rows($result_courseware);
                        if($row_courseware=$db->fetch_array($result_courseware)){
        ?>
                <div class="span4">
                    <h3><a href=""><?php echo($row['name']);?> </a></h3> 
                        课件数：<?php echo($resultcount)?>  &nbsp;个			  <p> 			  </p>
                        <p><a class="btn btn-info" href="?do=coursewarelist&major_id=<?php echo($row['id'])?>" <?php if($_SESSION['sid']==''){ ?> onclick="return checkLogin()" <?php }?> >进入 »</a></p>
                </div><!--/span-->
                <?php 
                        }
                }
                ?>
                
            </div><!--/row-->
        </div>
        
        
    </div>
        <?php }?>
</div>
